.class Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidOverlay;
.super Lcom/burstly/lib/component/networkcomponent/burstly/OverlayContainer;
.source "MraidOverlay.java"

# interfaces
.implements Landroid/view/View$OnClickListener;


# annotations
.annotation system Ldalvik/annotation/Signature;
    value = {
        "<T:",
        "Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidView;",
        ":",
        "Lcom/burstly/lib/component/networkcomponent/IActivityLifeCycleAware;",
        ">",
        "Lcom/burstly/lib/component/networkcomponent/burstly/OverlayContainer",
        "<TT;>;",
        "Landroid/view/View$OnClickListener;"
    }
.end annotation


# static fields
.field private static sGlobalMockViewIdCounter:I


# instance fields
.field mChildIndex:I

.field private mLayoutParams:Landroid/view/ViewGroup$LayoutParams;

.field private mLocalMockViewId:I

.field private mOriginalCloseButtonControl:Lcom/burstly/lib/component/networkcomponent/burstly/html/ICloseControl;


# direct methods
.method static constructor <clinit>()V
    .locals 1

    .prologue
    .line 44
    const/16 v0, 0x36b3

    sput v0, Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidOverlay;->sGlobalMockViewIdCounter:I

    return-void
.end method

.method constructor <init>(Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidView;Landroid/view/ViewGroup;)V
    .locals 1
    .parameter
    .parameter "contentRoot"
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(TT;",
            "Landroid/view/ViewGroup;",
            ")V"
        }
    .end annotation

    .prologue
    .line 75
    .local p0, this:Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidOverlay;,"Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidOverlay<TT;>;"
    .local p1, targetView:Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidView;,"TT;"
    invoke-direct {p0, p2, p1}, Lcom/burstly/lib/component/networkcomponent/burstly/OverlayContainer;-><init>(Landroid/view/ViewGroup;Landroid/view/View;)V

    .line 54
    const/4 v0, -0x1

    iput v0, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidOverlay;->mChildIndex:I

    .line 76
    sget v0, Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidOverlay;->sGlobalMockViewIdCounter:I

    add-int/lit8 v0, v0, 0x1

    sput v0, Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidOverlay;->sGlobalMockViewIdCounter:I

    iput v0, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidOverlay;->mLocalMockViewId:I

    .line 77
    return-void
.end method

.method private placeStubView(Landroid/view/ViewGroup;)V
    .locals 2
    .parameter "parent"

    .prologue
    .line 119
    .local p0, this:Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidOverlay;,"Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidOverlay<TT;>;"
    new-instance v0, Landroid/widget/FrameLayout;

    invoke-virtual {p0}, Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidOverlay;->getContext()Landroid/content/Context;

    move-result-object v1

    invoke-direct {v0, v1}, Landroid/widget/FrameLayout;-><init>(Landroid/content/Context;)V

    .line 120
    .local v0, mockView:Landroid/widget/FrameLayout;
    iget v1, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidOverlay;->mLocalMockViewId:I

    invoke-virtual {v0, v1}, Landroid/widget/FrameLayout;->setId(I)V

    .line 121
    const/high16 v1, -0x100

    invoke-virtual {v0, v1}, Landroid/widget/FrameLayout;->setBackgroundColor(I)V

    .line 122
    iget-object v1, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidOverlay;->mLayoutParams:Landroid/view/ViewGroup$LayoutParams;

    invoke-virtual {v0, v1}, Landroid/widget/FrameLayout;->setLayoutParams(Landroid/view/ViewGroup$LayoutParams;)V

    .line 123
    iget v1, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidOverlay;->mChildIndex:I

    invoke-virtual {p1, v0, v1}, Landroid/view/ViewGroup;->addView(Landroid/view/View;I)V

    .line 124
    return-void
.end method


# virtual methods
.method protected bridge synthetic addChildToLayout(Landroid/view/ViewGroup;Landroid/view/View;)Landroid/view/View;
    .locals 1
    .parameter "x0"
    .parameter "x1"

    .prologue
    .line 38
    .local p0, this:Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidOverlay;,"Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidOverlay<TT;>;"
    check-cast p2, Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidView;

    .end local p2
    invoke-virtual {p0, p1, p2}, Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidOverlay;->addChildToLayout(Landroid/view/ViewGroup;Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidView;)Lcom/burstly/lib/component/networkcomponent/burstly/html/CloseableContainer;

    move-result-object v0

    return-object v0
.end method

.method protected addChildToLayout(Landroid/view/ViewGroup;Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidView;)Lcom/burstly/lib/component/networkcomponent/burstly/html/CloseableContainer;
    .locals 2
    .parameter "containerLayout"
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Landroid/view/ViewGroup;",
            "TT;)",
            "Lcom/burstly/lib/component/networkcomponent/burstly/html/CloseableContainer",
            "<*>;"
        }
    .end annotation

    .prologue
    .line 158
    .local p0, this:Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidOverlay;,"Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidOverlay<TT;>;"
    .local p2, childView:Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidView;,"TT;"
    new-instance v0, Lcom/burstly/lib/component/networkcomponent/burstly/html/CloseableContainer;

    invoke-virtual {p0}, Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidOverlay;->getContext()Landroid/content/Context;

    move-result-object v1

    invoke-direct {v0, v1}, Lcom/burstly/lib/component/networkcomponent/burstly/html/CloseableContainer;-><init>(Landroid/content/Context;)V

    .line 159
    .local v0, container:Lcom/burstly/lib/component/networkcomponent/burstly/html/CloseableContainer;,"Lcom/burstly/lib/component/networkcomponent/burstly/html/CloseableContainer<TT;>;"
    invoke-virtual {v0, p2}, Lcom/burstly/lib/component/networkcomponent/burstly/html/CloseableContainer;->putIntoContainer(Landroid/view/View;)V

    .line 160
    invoke-virtual {v0, p0}, Lcom/burstly/lib/component/networkcomponent/burstly/html/CloseableContainer;->setCloseClickListener(Landroid/view/View$OnClickListener;)V

    .line 161
    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Lcom/burstly/lib/component/networkcomponent/burstly/html/CloseableContainer;->setShowCloseIndicator(Z)V

    .line 162
    invoke-virtual {p2, v0}, Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidView;->setCloseButtonControl(Lcom/burstly/lib/component/networkcomponent/burstly/html/ICloseControl;)V

    .line 163
    const/16 v1, 0x82

    invoke-virtual {p2, v1}, Landroid/view/View;->requestFocus(I)Z

    .line 164
    invoke-virtual {p1, v0}, Landroid/view/ViewGroup;->addView(Landroid/view/View;)V

    .line 165
    return-object v0
.end method

.method protected createContainerLayout()Landroid/view/ViewGroup;
    .locals 3

    .prologue
    .local p0, this:Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidOverlay;,"Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidOverlay<TT;>;"
    const/16 v2, 0xff

    .line 81
    new-instance v0, Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidOverlay$1;

    invoke-virtual {p0}, Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidOverlay;->getContext()Landroid/content/Context;

    move-result-object v1

    invoke-direct {v0, p0, v1}, Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidOverlay$1;-><init>(Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidOverlay;Landroid/content/Context;)V

    .line 87
    .local v0, layout:Landroid/widget/FrameLayout;
    const/16 v1, 0xc8

    invoke-static {v1, v2, v2, v2}, Landroid/graphics/Color;->argb(IIII)I

    move-result v1

    invoke-virtual {v0, v1}, Landroid/widget/FrameLayout;->setBackgroundColor(I)V

    .line 88
    return-object v0
.end method

.method public hideOverlayed()V
    .locals 6

    .prologue
    .line 128
    .local p0, this:Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidOverlay;,"Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidOverlay<TT;>;"
    invoke-virtual {p0}, Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidOverlay;->isShowing()Z

    move-result v4

    if-eqz v4, :cond_2

    .line 129
    invoke-super {p0}, Lcom/burstly/lib/component/networkcomponent/burstly/OverlayContainer;->hideOverlayed()V

    .line 130
    invoke-virtual {p0}, Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidOverlay;->getChildView()Landroid/view/View;

    move-result-object v0

    check-cast v0, Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidView;

    .line 131
    .local v0, childView:Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidView;,"TT;"
    invoke-virtual {v0}, Landroid/view/View;->getParent()Landroid/view/ViewParent;

    move-result-object v3

    check-cast v3, Landroid/view/ViewGroup;

    .line 132
    .local v3, parent:Landroid/view/ViewGroup;
    if-eqz v3, :cond_0

    .line 133
    invoke-virtual {v3, v0}, Landroid/view/ViewGroup;->removeView(Landroid/view/View;)V

    .line 135
    :cond_0
    invoke-virtual {p0}, Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidOverlay;->getContext()Landroid/content/Context;

    move-result-object v4

    check-cast v4, Landroid/app/Activity;

    iget v5, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidOverlay;->mLocalMockViewId:I

    invoke-virtual {v4, v5}, Landroid/app/Activity;->findViewById(I)Landroid/view/View;

    move-result-object v1

    .line 136
    .local v1, mockView:Landroid/view/View;
    const/4 v2, 0x0

    .line 137
    .local v2, mockViewParent:Landroid/view/ViewGroup;
    if-eqz v1, :cond_1

    .line 138
    invoke-virtual {v1}, Landroid/view/View;->getParent()Landroid/view/ViewParent;

    move-result-object v2

    .end local v2           #mockViewParent:Landroid/view/ViewGroup;
    check-cast v2, Landroid/view/ViewGroup;

    .line 139
    .restart local v2       #mockViewParent:Landroid/view/ViewGroup;
    invoke-virtual {v2, v1}, Landroid/view/ViewGroup;->removeView(Landroid/view/View;)V

    .line 140
    iget v4, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidOverlay;->mChildIndex:I

    iget-object v5, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidOverlay;->mLayoutParams:Landroid/view/ViewGroup$LayoutParams;

    invoke-virtual {v2, v0, v4, v5}, Landroid/view/ViewGroup;->addView(Landroid/view/View;ILandroid/view/ViewGroup$LayoutParams;)V

    .line 141
    instance-of v4, v2, Landroid/widget/ViewFlipper;

    if-eqz v4, :cond_1

    move-object v4, v2

    .line 142
    check-cast v4, Landroid/widget/ViewFlipper;

    iget v5, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidOverlay;->mChildIndex:I

    invoke-virtual {v4, v5}, Landroid/widget/ViewFlipper;->setDisplayedChild(I)V

    .line 145
    :cond_1
    iget-object v4, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidOverlay;->mOriginalCloseButtonControl:Lcom/burstly/lib/component/networkcomponent/burstly/html/ICloseControl;

    if-eqz v4, :cond_2

    .line 146
    iget-object v4, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidOverlay;->mOriginalCloseButtonControl:Lcom/burstly/lib/component/networkcomponent/burstly/html/ICloseControl;

    invoke-virtual {v0, v4}, Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidView;->setCloseButtonControl(Lcom/burstly/lib/component/networkcomponent/burstly/html/ICloseControl;)V

    .line 149
    .end local v0           #childView:Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidView;,"TT;"
    .end local v1           #mockView:Landroid/view/View;
    .end local v2           #mockViewParent:Landroid/view/ViewGroup;
    .end local v3           #parent:Landroid/view/ViewGroup;
    :cond_2
    return-void
.end method

.method public onClick(Landroid/view/View;)V
    .locals 1
    .parameter "v"

    .prologue
    .line 153
    .local p0, this:Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidOverlay;,"Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidOverlay<TT;>;"
    invoke-virtual {p0}, Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidOverlay;->getChildView()Landroid/view/View;

    move-result-object v0

    check-cast v0, Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidView;

    invoke-virtual {v0}, Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidView;->close()V

    .line 154
    return-void
.end method

.method public showOverlayed()V
    .locals 5

    .prologue
    .line 93
    .local p0, this:Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidOverlay;,"Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidOverlay<TT;>;"
    invoke-virtual {p0}, Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidOverlay;->isShowing()Z

    move-result v4

    if-nez v4, :cond_2

    .line 94
    invoke-virtual {p0}, Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidOverlay;->getChildView()Landroid/view/View;

    move-result-object v0

    check-cast v0, Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidView;

    .line 95
    .local v0, childView:Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidView;,"TT;"
    invoke-virtual {v0}, Landroid/view/View;->getLayoutParams()Landroid/view/ViewGroup$LayoutParams;

    move-result-object v4

    iput-object v4, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidOverlay;->mLayoutParams:Landroid/view/ViewGroup$LayoutParams;

    .line 96
    invoke-virtual {v0}, Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidView;->getCloseButtonControl()Lcom/burstly/lib/component/networkcomponent/burstly/html/ICloseControl;

    move-result-object v4

    iput-object v4, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidOverlay;->mOriginalCloseButtonControl:Lcom/burstly/lib/component/networkcomponent/burstly/html/ICloseControl;

    .line 97
    invoke-virtual {v0}, Landroid/view/View;->getParent()Landroid/view/ViewParent;

    move-result-object v3

    check-cast v3, Landroid/view/ViewGroup;

    .line 98
    .local v3, parent:Landroid/view/ViewGroup;
    if-eqz v3, :cond_1

    .line 99
    invoke-virtual {v3}, Landroid/view/ViewGroup;->getChildCount()I

    move-result v1

    .line 100
    .local v1, childrenCount:I
    const/4 v2, 0x0

    .local v2, i:I
    :goto_0
    if-ge v2, v1, :cond_0

    .line 101
    invoke-virtual {v3, v2}, Landroid/view/ViewGroup;->getChildAt(I)Landroid/view/View;

    move-result-object v4

    if-ne v4, v0, :cond_3

    .line 102
    iput v2, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidOverlay;->mChildIndex:I

    .line 106
    :cond_0
    invoke-virtual {v3, v0}, Landroid/view/ViewGroup;->removeView(Landroid/view/View;)V

    .line 107
    invoke-direct {p0, v3}, Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidOverlay;->placeStubView(Landroid/view/ViewGroup;)V

    .line 109
    .end local v1           #childrenCount:I
    .end local v2           #i:I
    :cond_1
    invoke-super {p0}, Lcom/burstly/lib/component/networkcomponent/burstly/OverlayContainer;->showOverlayed()V

    .line 111
    .end local v0           #childView:Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidView;,"TT;"
    .end local v3           #parent:Landroid/view/ViewGroup;
    :cond_2
    return-void

    .line 100
    .restart local v0       #childView:Lcom/burstly/lib/component/networkcomponent/burstly/html/mraid/MraidView;,"TT;"
    .restart local v1       #childrenCount:I
    .restart local v2       #i:I
    .restart local v3       #parent:Landroid/view/ViewGroup;
    :cond_3
    add-int/lit8 v2, v2, 0x1

    goto :goto_0
.end method
